package com.gnerv.tools.entity.extend.test;

import com.gnerv.tools.entity.extend.test.mapper.PermissionMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@SpringBootApplication
@ComponentScan(basePackages = {"com.gnerv.tools"})
@MapperScan(basePackages = {"com.gnerv.tools.**.mapper"})
@RestController
@CrossOrigin
public class EntityExtendSpringBootTestApplication {

    @Resource
    PermissionMapper permissionMapper;

    public static void main(String[] args) {
        SpringApplication.run(EntityExtendSpringBootTestApplication.class, args);
    }

    @RequestMapping(value = "get/{id}", method = RequestMethod.GET)
    public Object get(@PathVariable(value = "id") String id){
        PermissionDTO permissionDTO = permissionMapper.selectPermission(id);
//        Map<String, Object> stringObjectMap = permissionMapper.mapPermission1(id);
//        Map<String, Permission> stringPermissionMap = permissionMapper.mapPermission2(id);
//        Map<String, List<Permission>> stringListMap = permissionMapper.mapPermission3(id);
//
//        Map<String, Object> stringObjectMap1 = permissionMapper.selectPermissionMap(id);

        return permissionDTO;
    }

}
